package com.crm.system.controller.csd;

import com.crm.common.model.DataResponse;
import com.crm.common.model.DhResponse;
import com.crm.common.model.Enum.ResponseCodeEnum;
import com.crm.system.service.csd.CsdMainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 客服部首页
 * @Author renshaorong
 * @Date 2021/12/16 4:08 下午
 */
@RestController
@RequestMapping("/csdMain")
public class CsdMainController {

    @Autowired
    private CsdMainService csdMainService;

    /**
     * 客服首页简报数据
     *
     */
    @GetMapping("/getBriefing")
    public DataResponse getBriefing(){
        return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),csdMainService.getBriefing());
    }

    /**
     * 客服首页-合同趋势折线图数据
     *
     */
    @GetMapping("/listCsdContractReport")
    public DataResponse listCsdContractReport(Integer year){
        return new DhResponse(ResponseCodeEnum.OK.getResponseCode(),csdMainService.listCsdContractReport(year));
    }
}
